home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / vol16n09.zip / DETECTOS.BAT next >
DOS Batch File  |  1996-12-20  |  1KB  |  43 lines

  1. @ECHO OFF
  2. :: Windows NT sets the OS variable to "Windows_NT"
  3. IF '%OS%'=='Windows_NT' GOTO Done
  4.  
  5. SET OS=
  6. SET WINDIR=
  7. SET WINBOOTDIR=
  8. SET VWD=n
  9. SET VBD=n
  10.  
  11. IF NOT '%windir%'==''     SET VWD=Y
  12. IF NOT '%winbootdir%'=='' SET VBD=Y
  13. IF NOT '%VWD%%VBD%'=='nn' GOTO Not31
  14.  
  15. :: Distinguish DOS-pre-7 from Windows 3.x by seeking
  16. :: "windir=" in the output of the SET command.
  17. ECHO SET VWD=n>0.BAT
  18. ECHO SET VWD=Y>1.BAT
  19. SET | FIND /C "windir=" > DETECT$$.BAT
  20. CALL DETECT$$.BAT
  21. FOR %%v IN (0 1 DETECT$$) DO DEL %%v.BAT
  22.  
  23. :Not31
  24. IF '%VWD%%VBD%'=='nn' SET OS=DOS_pre_7
  25. IF '%VWD%%VBD%'=='nY' SET OS=DOS_7
  26. IF '%VWD%%VBD%'=='Yn' SET OS=Windows_3.x
  27. IF '%VWD%%VBD%'=='YY' SET OS=Windows_95
  28.  
  29. :Done
  30. ECHO Operating system is %OS%
  31.  
  32. :: If you NEVER run Windows 3.x under DOS 7, you can 
  33. :: delete this comment and the next two lines.
  34. IF NOT '%windir%'=='%winbootdir%' SET VBD=%VBD%n
  35. IF '%VWD%%VBD%'=='YYn' ECHO (or Windows 3.x under DOS 7)
  36.  
  37. :: Clean up environment variables
  38. FOR %%v IN (VWD VBD) DO SET %%v=
  39.  
  40.  
  41.  
  42.  
  43.